﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../Scripts/jquery-1.8.2.min.js"></script>
    <link href="../CSS/Public/base.css" rel="stylesheet" />
    <link href="../CSS/UserCenter/Reset.css" rel="stylesheet" />
    <link href="../CSS/UserCenter/Register.css" rel="stylesheet" />
    <script src="../JS/Public/Global.js"></script>
    <script src="../JS/UserCenter/Register.js"></script>
    <!--<script src="../JS/Public/myValidform.js"></script>-->

    <link href="../Content/StyleSheet1.css" rel="stylesheet" />
    <link href="../BootstrapSouce/css/bootstrap.min.css" rel="stylesheet" />
    <script src="../BootstrapSouce/js/jquery.min.js"></script>
    <script src="../BootstrapSouce/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            
        $.ajax({
            type: "get",
            url: "/Nav/shownav",
            success: function (data) {
                $(data).each(function (i, obj) {
                    var div = "<a href='" + obj.navurl + "' class='button'>" + obj.navname + "</a>";
                    $(".header-div2").append(div);
                })
            }
        })
        $.ajax({

            type: "get",
            url: "/Users/showtype",
            success: function (data) {
                $(data).each(function (i, obj) {
                    var option = " <option value='" + obj.usertype + "'>" + obj.typename + "</option>";
                    $("#sele").append(option);
                })
            }
        });
       
        $("#btn_Register").click(function () {
            var uname = $("#reg_mobile").val();
            if ($("#reg_mobile").val() == "") {
                $("#err_mobile").text("用户名不能为空");
            } //Session["uname"]
            else {
                $("#err_mobile").text("");
                ///判断用户名存不存在
                $.ajax({

                    type: "get",
                    url: "/Users/getuname",
                    data: {
                        "uname": uname
                    },
                    success: function (data) {
                        if (data > 0)
                        {
                            $("#err_mobile").text("用户名已存在");
                        }
                        else {
                            $("#err_mobile").text("");
                        }
                    }
                      
                })
              
                //if (uname == $("#id").val()) {
                //    $("#err_mobile").text("用户名已存在");
                //}
                //else {
                //    $("#err_mobile").text("");
                //}
            }
            if ($("#reg_pwd").val() == "") {
                $("#pwd").text("密码不能为空");
            }
            else {
                $("#pwd").text("");
            }
            if ($("#tel_mobile").val() == "") {
                $("#tel").text("电话号码不能为空");
            }
            else {

                $("#tel").text("");
            }
            if ($("#zpwd").val() == "") {
                $("#qpwe").text("确认密码不能为空");

            }
            else {
              
                if ($("#reg_pwd").val() != $("#zpwd").val()) {
                    $("#qpwe").text("两次密码不一样");
                }
                else {
                    $("#qpwe").text("");
                    if ($("#tel_mobile").val() == "") {
                        $("#tel").text("电话号码不能为空");
                    }
                   
                        $.ajax({
                            type: "get",
                            url: "/Users/add",
                            data: {
                                "uname": $("#reg_mobile").val(),
                                "upwd": $("#reg_pwd").val(),
                                "utel": $("#tel_mobile").val(),
                                "utype": $("#sele").val(),
                            },
                            success: function (data) {
                                if (data > 0) {
                                    location.href = "Login.html";
                                }
                                else {
                                    alert("注册失败");
                                }
                            }
                        })
                    

                }
              
            }

          

        })
    })
    </script>

</head>
<body>
    <div class="header-div1">

        <div id="baiduDiv" style="display:none; position:absolute;transform:translate(1055px,50px)">
            <img src="../Content/img/img/2016-11-27_111530.png" />

        </div>
        <div id="baiduDiv1" style="display:none; position:absolute;transform:translate(1000px,50px)">
            <img src="../Content/img/img/2016-11-27_111530.png" />
        </div>


        <a href="#"><img src="../Content/img/img/2016-11-27_092701.png" class="header-div1-img1" /></a>

        <a href="#"><img src="../Content/img/img/2016-11-27_092720.png" class="header-div1-img2" /></a>

        <a href="#" onmouseout="document.getElementById('baiduDiv1').style.display='none'" onmouseover="document.getElementById('baiduDiv1').style.display=''"><img src="../Content/img/img/2016-11-26_155210.png" class="header-div1-img3" /></a>
        <a href="#" onmouseout="document.getElementById('baiduDiv').style.display='none'" onmouseover="document.getElementById('baiduDiv').style.display=''">  <img src="../Content/img/img/2016-11-26_155309.png" class="header-div1-img4" /></a>
        <a><img src="../Content/img/img/2016-11-26_155336.png" class="header-div1-img5" /></a>
        <a href="#"><img src="../Content/img/img/2016-11-26_155436.png" class="header-div1-img6" /></a>


    </div>


    <div class="header-div2">
        <!--<a href="HtmlPage1.html" class="button">首页</a>
        <a href="Hotel.html" class="button">酒店</a>
        <a href="AirTicket.html" class="button">机票</a>
        <a href="Holiday.html" class="button">度假</a>
        <a href="#" class="button">签证</a>
        <a href="TrainTicket.html" class="button">火车票</a>&nbsp;-->
        <div style="float:right">
            <button class="button"><a href="Register.html" class="reg">注册</a><a href="Login.html" class="login">登陆</a></button>
        </div>
       
    </div>

    <!--end header-->

    <div class="content">
        <div id="hid">

        </div>
        <div class="login-step">
            <ul>
                <li class="active">填写信息</li>
            </ul>
        </div>
        <div id="Form_Register" class="login-con">
            <ul>
                <li>
                    <span class="label" style="color:black">用户名</span>
                    <input id="reg_mobile" class="input-val" type="text" value="" placeholder="可用作登录名" datatype="m" errormsg="手机号格式错误" nullmsg="手机号不能为空">
                    
                    
                        <span id="err_mobile" class="text-error"></span>
                </li>
               
                <li>
                    <span class="label" style="color:black">密码</span>
                    <input id="reg_pwd" name="reg_pwd" class="input-val" value="" type="password" placeholder="6-20位字母、数字和符号" datatype="*6-16" passwordstrength="passwordStrength" errormsg="密码格式错误" nullmsg="密码不能为空">
                    <span id="pwd" class="text-error"></span>
                </li>
               
                <li>
                    <span class="label" style="color:black">确认密码</span>
                    <input id="zpwd" class="input-val" type="password" value="" placeholder="再次输入密码" datatype="*6-16" passwordstrength="passwordStrength" errormsg="密码不一致" nullmsg="密码不能为空" recheck="reg_pwd">
                    <span id="qpwe" class=" text-error"></span>
                </li>
                <li>
                    <span class="label" style="color:black">电话号</span>
                    <input id="tel_mobile" class="input-val" type="text" value="" placeholder="电话号码" datatype="m"  nullmsg="手机号不能为空">
                    <span id="tel" class="text-error"></span>
                </li>
                <li>
                    <span class="label" style="color:black">用户类型</span>
                   <select id="sele">
                      
                   </select>
                </li>
                <!--<li>
                    <span class="label">验证码</span>
                    <input id="reg_code" class="input-val" type="text" value="" placeholder="验证码" datatype="*" nullmsg="验证码不能为空">
                    <div class="imgcode"><img id="img_ValidateCode" align='absmiddle' class="verify-img" title="点击刷新" src="../Public/LB6L5A_6KERCE3~L@U(WT70.png" /></div>
                    <span id="err_code" class=" text-error"></span>
                </li>-->
                <li>
                    <span class="label" style="color:black"></span>
                    <label><input id="btn_AgreeItem" type="checkbox" checked="checked">我同意尊重</label><a href="#" class="showTos">《你定旅行网协议》</a>
                </li>
                <li>
                    <span class="label" style="color:black"></span>
                    <input id="btn_Register" style="width:100px;height:50px" type="button" value="注册">
                </li>
            </ul>
        </div>
    </div>
    <div class="header-div5">
        <div class="div-dl">
            <dl>
                <dt>帮助中心</dt>
                <dd><a href="#">预定帮助</a></dd>
                <dd><a href="#">常见问题</a></dd>
                <dd><a href="#">用户协议</a></dd>
                <dd><a href="#">出行常识</a></dd>
            </dl>
        </div>
        <div class="div-dl">
            <dl>
                <dt>售后服务</dt>
                <dd><a href="#">售后政策</a></dd>
                <dd><a href="#">退款说明</a></dd>
                <dd><a href="#">取消订单</a></dd>
                <dd><a href="#">在线支付</a></dd>
            </dl>
        </div>
        <div class="div-dl">
            <dl>
                <dt>关于我们</dt>
                <dd><a href="#">关于你定网</a></dd>
                <dd><a href="#">创始人介绍</a></dd>
                <dd><a href="#">荣耀资质</a></dd>
                <dd><a href="#">公司介绍</a></dd>
            </dl>
        </div>
        <div class="div-dl">
            <dl><dt>手机快速扫描下载</dt><dd><img src="../Content/img/img/2016-11-27_111530.png" /></dd></dl>
        </div>
        <div class="div-dl">
            <dl><dt>你定官方微信</dt><dd><img src="../Content/img/img/2016-11-27_111418.png" /></dd></dl>
        </div>
        <div class="div-dl">
            <dl><dt>你定官方微博</dt><dd><img src="../Content/img/img/2016-11-27_111530.png" /></dd></dl>
        </div>
        <div class="div-d2">
            <dl><dt>联系我们</dt><dd><img src="../Content/img/img/2016-11-27_111619.png" /></dd></dl>
        </div>

        <div class="div-d3">
            <dl><dt>京ICP备11023779号</dt><dd><a href="#"><img src="../Content/img/img/2016-11-27_113039.png" /> </a></dd></dl>
        </div>



    </div>

</body>
</html>
